<?php
/**
 * The default template for displaying content
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?>

<div class="content_">
    <div class="content_title"> 
        <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr(sprintf(__('Permalink to %s', 'twentyeleven'), the_title_attribute('echo=0'))); ?>" rel="bookmark"><?php the_title(); ?></a> 
    </div>
    <div class="content_date">
        <?php if ('post' == get_post_type()) : ?> 
            <?php twentyeleven_posted_on(); ?> 
        <?php endif; ?>
    </div> 

    <div class="content_details">
        <div class="content_images">
<!--                <img src="<?php echo get_template_directory_uri(); ?>/images/img1.png" alt="" />-->
            <?php 
            if ( ! function_exists('catch_that_image') ) {
            function catch_that_image() {
                global $post;
                $first_img = '';
                ob_start();
                ob_end_clean();
                $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
                $first_img = $matches[1][0];
                if (empty($first_img)) { //Defines a default image
                    echo $first_img = "/images/default.jpg";
                } else {
                    echo $first_img;
                }
            } }
            ?>
            <img src="<?php catch_that_image() ?>" alt="" />
        </div>
        <div class="content_description">
                <?php if (is_search()) : // Only display Excerpts for Search   ?>
                <div class="entry-summary">
                <?php the_excerpt(); ?>
                </div><!-- .entry-summary -->
                <?php else : ?>
                <div class="entry-content">
                    <?php the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven')); ?>
                    <?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'twentyeleven') . '</span>', 'after' => '</div>')); ?>
                </div><!-- .entry-content -->
<?php endif; ?>
        </div>
    </div> 
</div>